<html lang="en"><head>
    <meta charset="UTF-8">
    <title>inputSelect实例</title>
    <link rel="stylesheet" href="./lib/layui/css/layui.css" media="all">
<body>
    <form class="layui-form" action="">

        <div class="layui-form-item">
            <label class="layui-form-label">选择框</label>
            <div class="layui-input-block inputSelect layui-form">
                <select name="test" lay-data="{method:'post',url:'/admin/config/test',field:'city'}"></select>
            </div>
        </div>
    
        <div class="layui-form-item">
            <label class="layui-form-label">选择框</label>
            <div class="layui-input-block inputSelect layui-form">
                <select name="city"></select>
                    <option value=""></option>
                    <option value="0">北京</option>
                    <option value="0">北京2</option>
                    <option value="1">上海</option>
                    <option value="2">广州</option>
                    <option value="3">深圳</option>
                    <option value="4">杭州</option>
                </select>
            </div>
        </div>
    
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</body>
<script src="./lib/layui/layui.js"></script>
<script>
     //注意:依賴form組件
     layui.config({
        base: './lib/layui_exts/',
    }).extend({
        inputSelect: 'inputSelect/inputSelect'
    }).use(['form', 'inputSelect'], function () {
        var form = layui.form,inputSelect = layui.inputSelect;
    });
</script>
</html>